﻿/*
 * KRPCContractAttribute
 * 
 * Author: snowdreamist
 * Date: 2011/11/24
 * 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BitTorrentSharp.KRPC.Messages;

namespace BitTorrentSharp.KRPC
{
    /// <summary>
    /// Service instance mode
    /// </summary>
    public enum ServiceInstanceMode
    {
        Singleton
    }

    /// <summary>
    /// KRPC Contract
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
    public class KRPCServiceContractAttribute : Attribute
    {
        /// <summary>
        /// Instance mode
        /// </summary>
        public ServiceInstanceMode InstanceMode { get; set; }
        /// <summary>
        /// Custom instance factory, null means use default service instance factory
        /// </summary>
        public Type CustomInstanceFactory { get; set; }
    }
}
